# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kimap
pkgver=24.08.2
pkgrel=0
pkgdesc="Job-based API for interacting with IMAP servers"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	cyrus-sasl-dev
	kcoreaddons-dev
	ki18n-dev
	kio-dev
	kmime-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
subpackages="$pkgname-dev"
_repo_url="https://invent.kde.org/pim/kimap.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kimap-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# loginjobtest is broken
	ctest --test-dir build --output-on-failure -E "loginjobtest" -j1
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
234f3888334a59ded89e057a05aed70712a8b1cc387bfefd025875cd13cc9d03b5d96891de77923aec78d645350ecdda4a5e043a66e7a308ac1f51b04ee7b9d2  kimap-24.08.2.tar.xz
"
